package com.xy.farm.activity.farm;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.xy.farm.R;
import com.xy.farm.activity.base.BaseActivity;
import com.xy.farm.activity.farm.adapter.BuyLandAdapter;
import com.xy.farm.activity.farm.adapter.RankListAdapter;

public class BuyLandActivity extends BaseActivity
{
    private RecyclerView recyclerView1;
    private RecyclerView recyclerView2;
    private BuyLandAdapter landAdapter;
    private RankListAdapter listAdapter;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_buy_land);
        findViewById(R.id.btn_submit).setOnClickListener(this);
        findViewById(R.id.btn_back).setOnClickListener(this);
        setTitle("鸡场");
        recyclerView1 = findViewById(R.id.recyclerView1);
        recyclerView2 = findViewById(R.id.recyclerView2);
        recyclerView1.setHasFixedSize(true);
        recyclerView2.setHasFixedSize(true);
        LinearLayoutManager manager1 = new LinearLayoutManager(this);
        manager1.setOrientation(LinearLayoutManager.HORIZONTAL);
        recyclerView1.setLayoutManager(manager1);
        recyclerView1.setAdapter((landAdapter = new BuyLandAdapter()));

        LinearLayoutManager manager2 = new LinearLayoutManager(this)
        {
            @Override
            public boolean canScrollVertically()
            {
                return false;
            }
        };
        manager2.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView2.setLayoutManager(manager2);
        recyclerView2.setAdapter((listAdapter = new RankListAdapter()));
    }
    @Override
    public void onClick(View v)
    {
        super.onClick(v);
        Intent intent;
        switch (v.getId())
        {
            case R.id.btn_submit:
                intent = new Intent(this, SettlementActivity.class);
                startActivity(intent);
                break;
        }
    }
}
